

#for...in...输出九九乘法表
for ni in range(1,10):
	for sh in range(1,ni+1):
		print('{}*{}={:<3}'.format(sh,ni,sh*ni),end="")

	print('')

for ni in range(9,0,-1):
	for sh in range(1,ni+1):
		print('{}*{}={:<3}'.format(sh,ni,sh*ni),end="")
	print('')
	


for ni in range(1,10):
	for u in range(1,10-ni):
		print('       ',end='')
	for sh in range(ni,0,-1):
		print('{}*{}={:<3}'.format(sh,ni,sh*ni),end="")	
	print('')



for ni in range(9,0,-1):
	for u in range(1,10-ni):
		print('       ',end='')
	for sh in range(ni,0,-1):
		print('{}*{}={:<3}'.format(sh,ni,sh*ni),end="")	
	print('')

#while语句输出九九乘法表
ni=1
while ni<=9:
	sh=1
	while sh<=ni:
		print("{}*{}={:<3}".format(sh,ni,sh*ni),end="")
		sh+=1
	print("")
	ni+=1

ni=9
while ni>=0 and ni<=9:
	sh=1
	while sh<=ni:
		print("{}*{}={:<3}".format(sh,ni,sh*ni),end="")
		sh+=1
	print("")
	ni-=1


ni=1
while ni<=9:
	u=1
	while u<=9-ni:
		print('       ',end='')
		u+=1
	sh=ni
	while sh>=1:
		print("{}*{}={:<3}".format(sh,ni,sh*ni),end="")
		sh-=1
	print("")
	ni+=1



ni=9
while ni>=0:
	u=1
	while u<=9-ni:
		print('       ',end='')
		u+=1
	sh=ni
	while sh>=1:
		print("{}*{}={:<3}".format(sh,ni,sh*ni),end="")
		sh-=1
	print("")
	ni-=1


